<!-- Modal -->
{% load i18n %}
<div class="teste_dialogo modal fade" id="modal_lista_departamentos" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close modal_cancel"  aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel">Departamentos</h4>
      </div>
      <div class="modal-body">
 <!--------------------------------------------------------------------------------------------------->
<div class="row">
        <table cellpadding="0" cellspacing="0" border="0" class="display sumary_table" id="special_table" width="100%">
                <thead>
                        <tr>
                                <th >{% trans 'Nome'%}</th>
                                <th><input type="checkbox" class="checkAll"></th>
                        </tr>
                </thead>
                <tbody>
                        {% for departamento in departamentos %}
                        <tr>
                                <td >{{departamento}}</td>
                                <td><input type="checkbox" value="{{departamento.id}}" class="checkable"></td>
                        </tr>
                        {% endfor %}
                </tbody>
        </table>
</div>
<!--------------------------------------------------------------------------------------------------->
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default modal_cancel" >Cancelar</button>
        <button type="button" onclick="form_escolha_departamentos();" class="btn btn-primary" id = "saveDepartamento">Adicionar</button>
      </div>
    </div>
  </div>
  <script type="text/javascript">
                $(document).ready(function() {
                        $('#special_table').DataTable({
                                "oLanguage": {
                            "sUrl": "/static/dataTables/lang/pt-pt.txt"
                        },  "aoColumnDefs": [
                                { "bSortable": false, "aTargets": [ 1 ] }
                                         ]
                         /*"sPaginationType": "full_numbers",*/
                         /*"sDom": '<"dataTables_special_bar"l><"dataTables_special_bar"if><"whiteBox"rt><"pagination_box"p>'*/
                       
                               
                        });
                        $('.hasTooltip').tooltip({"container": false});
               
                        $('.checkAll').click(function () {    
                             $('input:checkbox.checkable').prop('checked', this.checked);    
                        });
                });
               
               
              

               
        </script>

</div>

